#ifndef PHIDGET_ENC
#define PHIDGET_ENC

/*brief\ Phidget Encoder class
  Publishes to the following topics:
  1. "odom", which is of type nav_msgs::Odometry
  2. "ground_speed", which is of type geometry_msg::Vector3
  Also subscribes the following topic(s):
  1. "imu_data", which is of type sensor_msgs::Imu

  Required parameters:
  1. "ENC_frameID"

*/
#include <ros/ros.h>
#include <tf/tf.h>
#include <tf/transform_listener.h>
#include <nav_msgs/Odometry.h>
#include <sensor_msgs/Imu.h>
#include <geometry_msgs/Vector3.h>

// Phidget
#include <phidget21.h>
// Include config constants;
#include "config.h"

class PhidgetENC
{
 private:
  CPhidgetEncoderHandle enc_handle;

  // ROS node handlers
  ros::NodeHandle nh, pn;
  ros::Subscriber pose_sub;
  ros::Publisher gs_pub;	//ground speed publisher
  ros::Publisher odom_pub;
  tf::TransformListener trans;

  nav_msgs::Odometry enc_odom;
  
 public:
  PhidgetENC(ros::NodeHandle& n, ros::NodeHandle& p);
  ~PhidgetENC();

  void poseCallback(const sensor_msgs::Imu& imu_data);

 private:
  void init_phidget_enc(void);
  void init_ros_enc(void);
  // void condig_enc(void);
};

#endif
